package com.zhouchao.dubbo.service;

import com.zhouchao.dubbo.HelloService;
import org.apache.dubbo.config.annotation.DubboService;

import java.util.Random;

/**
 * @Author: zhouchao
 * @Date: 2021/09/17 21:06
 * @Description:
 */
@DubboService
public class HelloServiceImpl implements HelloService {
    @Override
    public String methodA() {

        Random random = new Random();
        int time = random.nextInt(100);

        try {
            Thread.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        return "methodA";
    }

    @Override
    public String methodB() {

        Random random = new Random();
        int time = random.nextInt(100);

        try {
            Thread.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        return "methodB";
    }

    @Override
    public String methodC() {

        Random random = new Random();
        int time = random.nextInt(100);

        try {
            Thread.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        return "methodC";
    }
}
